package com.originskyseed.platform.course.mapper;

import java.util.List;
import java.util.Map;

import com.originskyseed.platform.course.model.Paper;
import com.originskyseed.platform.course.model.TaskSelectPaperVO;

/**
 * 试卷信息Mapper类（OSI_PAPER）
 *
 * @author Tangwanghui
 */
public interface PaperMapper {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(Paper record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(Paper record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(Paper record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(Paper record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Paper selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<Paper> selectList(Paper record) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<Paper> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 任务发布选择试卷分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<TaskSelectPaperVO> taskSelectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 查询考卷编码是否存在
	 *
	 * @param paperNumber
	 * @return
	 * @throws Exception
	 */
	public String selectPaperNumber(String paperNumber) throws Exception;

	/**
	 * 查询最大优先级
	 * 
	 * @return
	 * @throws Exception
	 */
	public Integer selectPrority() throws Exception;

	/**
	 * 批量修改状态
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int updateStateByIds(Map<String, Object> map) throws Exception;

	/**
	 * 批量删除状态
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int updateIsDelByIds(Map<String, Object> map) throws Exception;

	/**
	 * 更新置顶记录
	 *
	 * @return
	 * @throws Exception
	 */
	public int updateIsTop() throws Exception;

	/**
	 * 根据优先级查询课程
	 * 
	 * @return
	 * @throws Exception
	 */
	public Paper selectPaperByPrority(Map<String, Object> map) throws Exception;

}
